import { Graph, Shape } from '@antv/x6';

export function init() {
  var ports = {
    groups: {
      group1: {
        attrs: {
          circle: {
            magnet: true,
            r: 4,
            fill: '#fff',
          },
        },
        position: 'top',
      },
      group2: {
        attrs: {
          circle: {
            magnet: true,
            r: 4,
            fill: '#fff',
          },
        },
        position: 'right',
      },
      group3: {
        attrs: {
          circle: {
            magnet: true,
            r: 4,
            fill: '#fff',
          },
        },
        position: 'bottom',
      },
      group4: {
        attrs: {
          circle: {
            magnet: true,
            r: 4,
            fill: '#fff',
          },
        },
        position: 'left',
      },
      
    },
    items: [{
      id: 'port1',
      group: 'group1',
      
    }, {
      id: 'port2',
      group: 'group2',
    }, {
      id: 'port3',
      group: 'group3',
    }, {
      id: 'port4',
      group: 'group4',
    }],
  };
  Graph.registerNode(
    'gateway',
    {
      inherit: 'polygon',
      ports,
      width: 50,
      height:50,
      attrs: {
        body: {
          refPoints: '0,10 10,0 20,10 10,20',
          strokeWidth: 2,
          stroke: '#222',
          fill: '#fff',
        },
        label: {
          text: '+',
          fontSize: 40,
          fill: '#222',
        },
      },
    },
    true,
  );
}
